package com.fasterxml.jackson.databind;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.text.SimpleDateFormat;

public class JsonMapper extends ObjectMapper {

	private static final long serialVersionUID = 1L;
	static ObjectMapper mapper = null;

	static {
		mapper = new ObjectMapper();
		mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
		mapper.disable(SerializationFeature.WRITE_NULL_MAP_VALUES); 
		mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
		mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
	}

	public JsonMapper() {
		super(mapper);
	}
}
